<?php

class Confirm extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model('costumer');
        $this->load->model('document');
        $this->load->model('ym');
    }

    function index() {
        $link = $this->uri->segment(3);
        $chek = $this->costumer->chek_confirmation($link);
        if ($chek == 1) {
            $confirm = 2;
            $this->costumer->user_confirm($link, $confirm);
        } elseif ($chek == 2) {
            echo "Your account already active";
        } else {
            echo "No Acount found";
        }
    }

    function success() {
        echo "Your Acount has been Activeted<br />";
        echo "Login here " . anchor('login/costumer', 'Login');
    }

    function newpass() {
        $data['yms'] = $this->ym->admin();
        $data['documents'] = $this->document->index();

        $link = $this->uri->segment(3);
        $data['rows'] = $this->costumer->check_link($link);
        $data['content'] = 'login/newpass';
        $this->load->view('template/login', $data);
    }

}

?>
